/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.click.app.dao.hibernate;

import com.click.app.dao.StorageCutDao;
import com.click.app.model.StorageCut;
import java.util.List;

/**
 *
 * @author ariel
 */
public class StorageCutDaoHibernate extends GenericDaoHibernate<StorageCut, Long> implements StorageCutDao{

    public StorageCutDaoHibernate() {
        super(StorageCut.class);
    }

    public List<StorageCut> findByModel(Long idModel, Long idModelSize, Long idMaterial) {
        Object[] values={idModel, idModelSize, idMaterial};
        //return getHibernateTemplate().find("from StorageCut where model.id=? AND modelSize.id=? AND material.id=?", values);
        return getHibernateTemplate().find("from StorageCut where pantDesign.model.id=? AND pantDesing.modelSize.id=? AND pantDesing.material.id=?", values);
    }
    public List<StorageCut> findByPantDesign(Long idPantDesign) {
        return getHibernateTemplate().find("from StorageCut where pantDesign.id=? ", idPantDesign);
    }
    public List<StorageCut> getAllGreaterThanCero(){
        return getHibernateTemplate().find("from StorageCut where stock>0 ");
    }
}
